﻿#if UNITY_EDITOR
using System;
using UnityEngine;
/// <summary>
/// 数组最大数量属性
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class ESF_ArrayMaxLengthAttribute : PropertyAttribute
{
    /// <summary>
    /// 数组最大数量属性
    /// </summary>
    /// <param name="_enumType">枚举</param>
    public ESF_ArrayMaxLengthAttribute(Type _enumType)
        : this(_enumType.ESF_ToValue().Count)
    {

    }

    /// <summary>
    /// 数组最大数量属性
    /// </summary>
    /// <param name="_maxNum">最大数量</param>
    public ESF_ArrayMaxLengthAttribute(int _maxNum)
    {
        maxNum = _maxNum;
    }

    /// <summary>
    /// 最大数量
    /// </summary>
    public int maxNum { get; private set; }
}
#endif
